.PHONY: all build clean

OUTPUT_DIR := bin

all:
	make clean
	make build-linux
	make build-darwin
	make build-windows

build-linux:
	cd msignaling && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ../$(OUTPUT_DIR)/msignaling-linux .
	cd mstun && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ../$(OUTPUT_DIR)/mstun-linux .

build-darwin:
	cd msignaling && CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ../$(OUTPUT_DIR)/msignaling-darwin .
	cd mstun && CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ../$(OUTPUT_DIR)/mstun-darwin .

build-windows:
	cd msignaling && CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ../$(OUTPUT_DIR)/msignaling-windows.exe .
	cd mstun && CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ../$(OUTPUT_DIR)/mstun-windows.exe .

clean:
	rm -rf $(OUTPUT_DIR)
